package com.augurit.common.base.extmodel.base;

import java.util.List;

/**
 * Ext树节点对应的java类
 */
public class BaseTreeNode<T> extends ExtElement implements ITreeNode<T> {
	
	// 属性
	protected boolean leaf;		//是否叶子节点
	protected String qtip;		//节点提示说明
	protected List<T> children;	//子节点
	
	/**
	 * 判断是否为树节点
	 * @param id
	 * @return
	 */
	public static boolean isRootNode(String id){
		if(id != null && id.equals(ITreeNode.ROOT_ID))
			return true;
		else
			return false;
	}
	
	/**
	 * 判断是否为树节点
	 * @param id
	 * @return
	 */
	public static boolean isRootNode(Long id){
		return isRootNode(id != null ? id.toString() : null);
	}

	
	public boolean isLeaf() {
		return leaf;
	}
	public void setLeaf(boolean leaf) {
		this.leaf = leaf;
	}
	public String getQtip() {
		return qtip;
	}
	public void setQtip(String qtip) {
		this.qtip = qtip;
	}

	public List<T> getChildren() {
		return children;
	}

	public void setChildren(List<T> children) {
		this.children = children;
	}
}
